home *** CD-ROM | disk | FTP | other *** search
/ Aminet 31 / Aminet 31 (1999)(Schatztruhe)[!][Jun 1999].iso / Aminet / util / rexx / rmh.lha / rmh / examples / dtime.rexx < prev    next >
OS/2 REXX Batch file  |  1999-04-23  |  666b  |  28 lines

  1. /*
  2. Show the use of some date/time function
  3. Usage: rx dtime
  4. */
  5.  
  6. l="rmh.library";if ~show("L",l) then;if ~addlib(l,0,-30) then exit
  7. prg=ProgramName("NOEXT")
  8.  
  9. call GetDate("D")
  10. say "Time is:" d.days "days " d.minute "minute " d.tick "ticks"
  11.  
  12. say "That is in human form:" formatdate("D","%m %w %d %Y %H:%M:%S")
  13.  
  14. call ds2tv("D")
  15. t.secs=GMTOffset()*60
  16. call AddTime("D","T")
  17. call tv2ds("D")
  18. say "and in GMT" formatdate("D","%m %w %d %Y %H:%M:%S GMT")
  19.  
  20. say "Now let's wait 5 seconds (or a ctrl-c)..."
  21. tim=CreateTimer()
  22. ts=TimerSignal(tim)
  23. call StartTimer(tim,5)
  24. res=Wait(or(ts,2**12))
  25. if and(res,ts)~=0 then say "timeout"
  26. if and(res,2**12)~=0 then say "ctrl-c"
  27. say "bye..."
  28.